package org.zfes.snowier.cloud.zbss.pmp.router.service.pm;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.zfes.snowier.auth.shiro.util.SecurityUtil;
import org.zfes.snowier.cloud.zbss.pmp.dto.PmpProjectGroupDetailDto;
import org.zfes.snowier.cloud.zbss.pmp.dto.PmpProjectMemberDto;
import org.zfes.snowier.cloud.zbss.pmp.dto.PmpProjectVersionCreateDto;
import org.zfes.snowier.cloud.zbss.pmp.model.PmpProject;
import org.zfes.snowier.cloud.zbss.pmp.service.IPmpProjectService;
import org.zfes.snowier.cloud.zbss.pmp.service.IPmpProjectVersionService;
import org.zfes.snowier.cloud.zbss.pmp.service.IpmpProjectGroupService;
import org.zfes.snowier.core.data.ComboboVo;
import org.zfes.snowier.core.data.DataSet;
import org.zfes.snowier.web.controller.BaseController;
import java.util.List;
import java.util.Map;
import java.util.Optional;
@Controller("org.zfes.snowier.cloud.zbss.pmp.router.service.pm.PmpProjectVersionController")
@RequestMapping("/pmp/service/pm/pmpProjectVersion")
public class PmpProjectVersionController extends BaseController {


    @Autowired
    private IPmpProjectVersionService projectVersionService;
    
    @RequestMapping(value="/createVersion", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public @ResponseBody  Object createVersion(PmpProjectVersionCreateDto versionCreateDto){
         projectVersionService.createPmpProjectVersion(versionCreateDto);
        return ajaxDoneSuccess("数据操作成功 ");
    }
    
    @RequestMapping(value="/updateVersion", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public @ResponseBody  Object updateVersion(PmpProjectVersionCreateDto versionUpdateDto){
         projectVersionService.updatePmpProjectVersion(versionUpdateDto);
        return ajaxDoneSuccess("数据操作成功 ");
    }
    
    @RequestMapping(value="/deleteVersion", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public @ResponseBody  Object deleteVersion(Long id){
         projectVersionService.setPmpProjectVersionStatus(id, Byte.valueOf("-1"));
        return ajaxDoneSuccess("数据操作成功 ");
    }
 
    
}
